package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;





import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.VipSettingDao;
import com.platform.server.service.VipSettingService;
import com.platform.server.util.StringTools;
@Service
public class VipSettingServiceImpl implements VipSettingService{
	
	@Autowired
	private VipSettingDao vipSettingDao;
	
	@Override
	public List<Map<String, Object>> selectSetting(String id, String is_auth,
			String create_at, String update_at, String money) {
		Map<String,Object> map = new HashMap<>();
		map.put("createAt", create_at);
		if(!StringTools.isEmpty(id)){
			map.put("id", Integer.parseInt(id));
		}
		map.put("updateAt", update_at);
		map.put("isAuth", is_auth);
		map.put("money", money);
		return vipSettingDao.selectSetting(map);
	}

	@Override
	public int updateVipSetting(Integer id, String is_auth, String create_at,
			String update_at, String money) {
		Map<String,Object> map = new HashMap<>();
		map.put("id", id);
		map.put("create_at", create_at);
		map.put("update_at", update_at);
		map.put("is_auth", is_auth);
		map.put("money", money);
		return vipSettingDao.updateVipSetting(map);
	}

	@Override
	public int insertVipSetting(Integer id, String is_auth, String create_at,
			String update_at, String money) {
		Map<String, Object> map = new HashMap<>();
		map.put("create_at", create_at);
		map.put("update_at", update_at);
		map.put("is_auth", is_auth);
		map.put("money", money);
		map.put("id", id);
		return vipSettingDao.insertVipSetting(map);
	}

}
